# ------------------------------------------------------------
# ::                        WIGA-SOFT                       ::
# ------------------------------------------------------------
# urls.py
# URL configuration (URL mapping to python methods)
# Created by: Vycas
# Version: 1.0
# ------------------------------------------------------------

from django.conf.urls.defaults import *
from django.contrib.auth.views import *
from pao.views import *
from pao.admin import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # [Personal]
    (r'^personal/(\w+)/(\d+)$', viewProjectTasksReport),
    (r'^personal/(\w+)$', viewPersonalReport),

    # [Project manager]
    (r'^project/manager/(\d+)$', viewProjectManagerReport),
    (r'^project/list/(\w+)$', viewProjectListReport),
    (r'^project/intensity/(\d+)$', viewProjectIntensityReport),
    (r'^project/intensity/(\d+)/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewProjectIntensityReport),
    (r'^project/budget/(\d+)$', viewProjectBudgetReport),
    (r'^project/budget/(\d+)/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewProjectBudgetReport),

    # [Department manager]
    (r'^department/manager/(\d+)$', viewDepartmentManagerReport),
    (r'^department/manager/(\d+)/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewDepartmentManagerReport),
    (r'^department/projects/(\d+)$', viewDepartmentProjectsReport),
    (r'^department/projects/(\d+)/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewDepartmentProjectsReport),
    (r'^department/budget/(\d+)$', viewDepartmentBudgetReport),
    (r'^department/budget/(\d+)/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewDepartmentBudgetReport),
    (r'^department/employees/(\d+)$', viewDepartmentEmployeeReport),
    (r'^department/load/(\d+)$', viewDepartmentLoadReport),

    # [Enterprise]
    (r'^enterprise/manager$', viewEnterpriseManagerReport),
    (r'^enterprise/manager/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewEnterpriseManagerReport),
    (r'^enterprise/unexecuted$', viewEnterpriseUnexecutedReport),
    (r'^enterprise/projects$', viewEnterpriseProjectsReport),
    (r'^enterprise/projects/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewEnterpriseProjectsReport),
    (r'^enterprise/budget$', viewEnterpriseBudgetReport),
    (r'^enterprise/budget/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewEnterpriseBudgetReport),
    (r'^enterprise/load$', viewEnterpriseLoadReport),
    (r'^enterprise/load/((?:\d{4}-\d{1,2})|(?:-))/((?:\d{4}-\d{1,2})|(?:-))$', viewEnterpriseLoadReport),
    (r'^enterprise/employees/$', viewEnterpriseEmployeeReport),

    # [Login]
    (r'^login$', login),
    (r'^logout$', logout_then_login, {'login_url': '/login'}),
    
    # [Change Password]
    (r'^password/change$', password_change),
    (r'^password/changedone$', password_change_done),
    
    # [Reset Password]
    (r'^password/reset$', password_reset),
    (r'^password/resetdone$', password_reset_done),
    (r'^password/resetconfirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)$', password_reset_confirm),
    (r'^password/resetcomplete$', password_reset_complete),

    # [Admin]
    (r'^admin/upload$', upload),
    (r'^admin/upload/success$', uploadSuccess),
    (r'^admin/upload/error$', uploadError),
    (r'^admin/', include(admin.site.urls)),

    # [Testing]
    (r'^styles/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': 'pao/styles'}),
    (r'^images/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': 'pao/images'}),
    (r'^js/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': 'pao/js'}),
    (r'^help/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': 'pao/help'}),   
    
    # [Index]
    (r'^$', index),
)
